Allow irb switches to set the prompt mode #356
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Emacs uses irb --inf-ruby-mode to, among other things, set a specific
prompt mode. However, RVM's irbrc.rb was unconditionally overriding the
prompt mode. The user could still set the prompt mode in ~/.irbrc, but
I didn't see any easy way to check if irb was called with
--inf-ruby-mode or --prompt[-mode] from irbrc, so I'd just be swapping
out one unconditional prompt mode override (:RVM) for another (e.g.
:INF_RUBY) which isn't what I wanted--I should get the nice RVM prompt
when I run irb from a shell but Emacs should also be able to get the
prompt mode it wants.
Hence this change, which only changes PROMPT_MODE if it's set to
:DEFAULT, which should be the case unless the user supplied a prompt
mode on the command line.